<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('borrow_books', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id');
            $table->integer('book_id');
            $table->timestamp('borrow_date')->comment('借阅时间');
            $table->timestamp('end_date')->comment('结束时间');
            $table->timestamp('return_date')->comment('归还时间');
            $table->string('illegal')->comment('逾期');
            $table->integer('manage_id')->comment('借阅管理员');
            $table->integer('status')->comment('状态');
            $table->timestamps();
        });

        DB::statement("alter table borrow_books comment '借阅'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('borrow_books');
    }
};
